<template>
  <div>
    <van-nav-bar title="晒图详情" fixed left-arrow @click-left="onClickLeft"></van-nav-bar>
    <div class="content">
      <van-image fit="cover" :src="'/uploads'+shaituData.thumb0"></van-image>
      <van-cell-group>
        <van-field center clearable label="请输入评论:">
          <van-button slot="button" size="small" type="primary">评论</van-button>
        </van-field>

      </van-cell-group>
      <van-cell-group>
        <!-- <van-cell title="用户名" value="日期" label="评论信息"/> -->
            <!-- {{replyData}} -->
        <template v-for="(v,i) in replyData">
            <van-cell :title="v.user_name===null?'莫得用户名':v.user_name" :value="v.reply_time" :label="v.reply" :key='i' />
        </template>
      </van-cell-group>
    </div>
  </div>
</template>
<script>
export default {
  name: 'sharedetail',
  methods: {
    onClickLeft () {
      this.$root.$router.go(-1)
    }
  },
  mounted () {
    this.$axios
      .get('/api/slists/mod/shaireply', {
        params: {
          related: 1
        //   ,
        //   shaitu_id: this.$route.query.data.id
        }
      })
      .then(response => {
        this.replyData = response.data
      })
  },
  data () {
    return {
      shaituData: this.$route.query.data,
      replyData: []
    }
  }
}
</script>
<style scoped>
.content {
  margin-top: 50px;
  padding: 1rem;
}
.content > .van-image {
  height: 12rem;
  width: 100%;
}
</style>
